package dao

import (
	"context"
	"user/database"
	"user/internal/model"
)

type userDao struct {
	*database.DBConn
}

func NewUserDao(conn *database.DBConn) *userDao {
	return &userDao{
		conn,
	}
}

func (d *userDao) Save(ctx context.Context, user *model.User) error {
	//sql := fmt.Sprintf("insert into %s (name,gender) values(?,?)", user.TableName())
	//result, err := d.Conn.ExecCtx(ctx, sql, user.Name, user.Gender)
	//if err != nil {
	//	return err
	//}

	id := 1

	user.Id = int64(id)
	return nil
}
